package com.globallogic.jira.generators;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.atlassian.configurable.ValuesGenerator;
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.project.Project;

/**
 * @author yegor.chumakov
 */
public class ProjectValuesGenerator implements ValuesGenerator {
    public Map<String, String> getValues(
	    @SuppressWarnings("rawtypes") Map userParams) {
	Map<String, String> projectMap = new HashMap<String, String>();
	List<Project> allProjects = ComponentManager.getInstance()
		.getProjectManager().getProjectObjects();

	for (Project project : allProjects) {
	    projectMap.put(project.getName(), project.getName());
	}
	return projectMap;
    }
}